﻿using Furion;
using Furion.DatabaseAccessor;
using YFurion.Locators;

namespace YFurion.Application
{
    public abstract class EFCoreServiceBase : EFCoreServiceBase<MasterDbContextLocator, SlaveDbContextLocator>
    {
    }

    public abstract class EFCoreServiceBase<TMasterDbContextLocator, TSlaveDbContextLocator> : ServiceBase
        where TMasterDbContextLocator : class, IDbContextLocator
        where TSlaveDbContextLocator : class, IDbContextLocator
    {
        protected IMSRepository<TMasterDbContextLocator, TSlaveDbContextLocator> MSRepository { get; }

        protected EFCoreServiceBase()
        {
            MSRepository = App.GetService<IMSRepository<TMasterDbContextLocator, TSlaveDbContextLocator>>();
        }
    }
}
